<?php
namespace Home\Controller;
use Think\Controller;
class CsController extends Controller {
    public function index(){
        $str="";

        $arr=explode('||',$str);
        foreach($arr as $key=>$value){
            $vArr=array_values(array_filter(explode("\r\n",$value)));
            foreach($vArr as $k=>$v){
                $vArr[$k]=str_replace(' ','-',$v);
                $vArr[$k]=str_replace('（解）','',$vArr[$k]);
            }
            $vArr['name']=mb_substr($vArr[0],0,2,'utf-8');
            $vArr['gua']=mb_substr($vArr[0],3,1,'utf-8');
            $vArr['star1']="{$vArr[1]}|{$vArr[2]}|{$vArr[3]}";
            $vArr['star2']="{$vArr[4]}|{$vArr[5]}|{$vArr[6]}";
            $vArr['star3']="{$vArr[7]}|{$vArr[8]}|{$vArr[9]}";
            $vArr['data1']="{$vArr[10]}|{$vArr[11]}";
            $vArr['data2']="{$vArr[12]}|{$vArr[13]}";
            $vArr['data3']="{$vArr[14]}|{$vArr[15]}";
            $vArr['data4']="{$vArr[16]}|{$vArr[17]}";
            $vArr['data5']="{$vArr[18]}|{$vArr[19]}";
            $vArr['data6']="{$vArr[20]}|{$vArr[21]}";
            $vArr['data7']="{$vArr[22]}|{$vArr[23]}";
            $vArr['data8']="{$vArr[24]}|{$vArr[25]}";
            dump($vArr);
            //exit;
            //M()->query("insert into tb_jp_data_ggzlm (name,gua,star1,star2,star3,pd,ge,jy,xd,xz,hy,zx,sc)values('{$vArr['name']}','{$vArr['gua']}','{$vArr['star1']}','{$vArr['star2']}','{$vArr['star3']}','{$vArr['data1']}','{$vArr['data2']}','{$vArr['data3']}','{$vArr['data4']}','{$vArr['data5']}','{$vArr['data6']}','{$vArr['data7']}','{$vArr['data8']}')");
        }

    }
}